using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

using Advent.aiDevices;

namespace Advent.Controls
{
    public partial class AI5620Status : Advent.Controls.StatusCtrl
    {

        private AI5620_TE_Simulator.StatusManager Status;

        public AI5620Status()
        {
            InitializeComponent();
        }


        /// <summary>
        /// This assigns the status manager which will be used by this control
        /// </summary>
        public void SetStatus(AI5620_TE_Simulator.StatusManager Status)
        {
            this.Status = Status;
        }

        protected override void timer_Update_Tick(object sender, EventArgs e)
        {
            try
            {
                if (Status == null) return;

                UpdateBasicMeasurements(Status.FilteredLevel, Status.MeterFrequency, Status.LineVoltage, Status.LoopCurrent);
                UpdateLineState(Status.LineState,Status.IsRingingDetected);
            }
            catch { }  
            
        }
        

    }
}
